<template>
    <div>
        <!-- <van-tabs @click="onClick" v-model:active="activet">
            <van-tab title="正在热映"></van-tab>
            <van-tab title="即将上映"></van-tab>
        </van-tabs> -->
        <van-tabs v-model:active="activet" @click-tab="onClick">
            <van-tab title="正在热映"></van-tab>
            <van-tab title="即将上映"></van-tab>
        </van-tabs>
    </div>
</template>

<script>
import { createApp } from 'vue';
import { Tab, Tabs } from 'vant';

const app = createApp();
app.use(Tab);
app.use(Tabs);
export default {
    created() {
        
    },
    computed: {
        activet:{
            get(){
                return this.$store.state.activet
            },
            set(){
                this.$store.commit('changeActivet', this.name)
            }
        }
        
    },
    mounted() {
        this.$router.push('/movie/nowplaying')
    },
    methods: {
        onClick(name) {
            // console.log(name,111);
            if (name.title === "正在热映") {
                this.$router.push('/movie/nowplaying')
            }else{
                this.$router.push('/movie/moviedetail')
            }
        },
    },
}
</script>

<style>
    
</style>
